package jsyf.oa.dao.task;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jsyf.oa.entity.task.SignRemindEntity;
import jsyf.oa.idao.BaseDao;
import jsyf.oa.ientity.IBaseEntity;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Repository;

/**
 * Created by y on 2018/5/3.
 */
@Repository
public class SignRemindDao extends BaseDao {
    public SignRemindDao() {
        super.iBaseEntity=new SignRemindEntity();
    }

    @Override
    public IBaseEntity convertJson2Entity(JSONObject json) {
        return JSON.toJavaObject(json, SignRemindEntity.class);
    }

    public JSONObject getByConditon(String condition){
        StringBuffer sql=new StringBuffer();
        sql.append(" SELECT");
        sql.append(" ID AS id,");
        sql.append("  REMARK AS remark,");
        sql.append(" REPORT_DATE as reportDate,");
        sql.append(" STATE as state");
        sql.append(" FROM T_SYS_TASK");
        sql.append(condition);
        return super.queryForJsonObject(sql.toString());

    }
}
